package com.wisely.highlight_spring4.ch1.di;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
import org.springframework.beans.factory.xml.XmlBeanFactory;
import org.springframework.core.io.Resource;

public class MyXmlBeanFactory extends XmlBeanFactory
{
	private final XmlBeanDefinitionReader reader = new XmlBeanDefinitionReader(this);

	public MyXmlBeanFactory(Resource resource) throws BeansException
	{
		this(resource, null);
	}

	public MyXmlBeanFactory(Resource resource, BeanFactory parentBeanFactory) throws BeansException
	{
		super(resource, parentBeanFactory);
		this.reader.setDocumentReaderClass(MyXMLProcess.class);
		this.reader.loadBeanDefinitions(resource);
	}
}
